package symbol;

import java.util.Hashtable;

public abstract class LMethodAdapter implements LMethod
{
	
	private Hashtable<String, Float> defaultParameters;
	private LSymbol removedSymbol;
	public void calculate(LSymbol removedSymbol, LSymbol calculatedSymbol, Hashtable<String, Float> defaultParameters)
	{
		this.removedSymbol=removedSymbol;
		this.defaultParameters=defaultParameters;
		
		calculate(calculatedSymbol);
	}
	
	public Float getParameter(String name){
		Float p = removedSymbol.getParameter(name);
		if(p==null)
			return defaultParameters.get(name);
		else
			return p;
	}
	
	public abstract void calculate(LSymbol calculatedSymbol);			
	
}
